/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;

/**
 *
 * @author user
 */
public class bai16 {
    public static void main(String[] args) {
        System.out.println(Invert("12345"));
    }
    
    private static String Invert(String s){
        if(s.length()==1) return s;
        return s.substring(s.length()-1,s.length())+Invert(s.substring(0,s.length()-1));
    }
}
